Router = require('koa-router')
chalk = require('chalk')

koa_url = require('../../koa/url')

_require = koa_url._require

koa_url._require = (path)->
    console.log chalk.yellowBright(path)
    _require.apply @, arguments



_register = Router.prototype.register

_url = {}

Router.prototype.register = (path, methods, middleware, opts)->
    if methods.length
        for i in methods
            if i of _url
                _url[i].push path
            else
                _url[i] = [path]
    else
        for i, li of _url
            console.log chalk.gray(i)
            for j in li
                if j == "/"
                    j = ""
                console.log " ",chalk.yellow(path+j)
        _url = {}

    _register.apply @,arguments




